package com.shop.cloud.service.hongfu.impl;

import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.shop.cloud.common.mybatis.BaseService;
import com.shop.cloud.common.mybatis.MybatisDao;
import com.shop.cloud.dao.hongfu.MessageDao;
import com.shop.cloud.domain.hongfu.Message;
import com.shop.cloud.service.hongfu.IMessageService;

/**
 * message
 */
@Service("messageService")
public class MessageService extends BaseService<Message> implements IMessageService{
    
    @Autowired
	private MessageDao messageDao;

	@Override
	public MybatisDao<Message> getEntityDao() {
		return messageDao;
	}

	@Override
	public int delete(String messageID) {
		// TODO Auto-generated method stub
		int resultInt = 0;
		
		if(StringUtils.isNotEmpty(messageID)){
			Message message = this.get(new Long(messageID));
			message.setStatus(1);
			
			resultInt = this.update(message);
		}
		
		return resultInt;
	}
    
}